package com.kx.yooli.kx.wechat.base.SmsReturnCode;

/**
 * @author john_sqwen-childe.wen
 * date 2024/4/8
 * PROJECT_NAME wechat
 * description create SmsReturnCode by john_sqwen
 * and  value is
 */
public enum SmsReturnCode {

    Success(0, "发送成功"),
    SmsIsNull(1, "短信实体为Null"),
    MobileIsEmpty(2, "接收手机号为空"),
    ContentIsEmpty(3, "短信内容为空"),
    InvalidCompanyCode(4, "无效的公司代码"),
    MobileInBlackList(5, "手机号在黑名单中"),
    OverFlowControl(6, "短信发送量超过阀值设置"),
    SystemException(7, "系统异常"),
    SignWrong(8, "短信签名错误"),
    SmsIdIsEmpty(9, "短信ID为空或为null"),
    SignIsEmpty(10, "短信签名为空"),
    MobileFormatWrong(11, "错误的手机号码格式"),
    NotAllowSendBetween23And7(12, "23点至7点间不允许发送非验证码短信"),
    ExpireSms(13, "短信发送时效已过期"),
    SmsSendTimeIsNull(14, "短信发送时间为Null"),
    Unknown(15, "未知结果, 短信平台返回未映射的结果。");

    private int code;

    private String desc;

    private SmsReturnCode(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public static String getDesc(int code) {
        for (SmsReturnCode sms : SmsReturnCode.values()) {
            if (sms.getCode() == code) {
                return sms.getDesc();
            }
        }
        return null;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
